import request from '@/utils/request'

export function createSite (site) {
  return request({
    url: '/v01/namespace/create',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: site
  })
}

export function updateSite (site) {
  return request({
    url: '/v01/namespace/update',
    method: 'put',
    // params: {
    // },
    data: site
  })
}

export function allSite () {
  return request({
    url: '/v01/namespace/all',
    method: 'get'
  })
}

export function siteDeposit (data) {
  return request({
    url: `/v01/namespace/balance`,
    method: 'put',
    data: data
  })
}

export function siteDeposits (namesapce) {
  return request({
    url: `/v01/namespace/${namesapce}/deposits`,
    method: 'get'
  })
}

export function siteInfo () {
  return request({
    url: '/v01/namespace/my',
    method: 'get'
  })
}

export function siteName () {
  return request({
    url: '/v01/namespace/siteName',
    method: 'get'
  })
}
